<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>  
  		<link href="${request.contextPath}/css/estilo.css" rel="stylesheet" type="text/css" />
    </h:head> 
	
<h:body>
<ui:composition template="../WEB-INF/templates/templateMain.xhtml">
	<ui:define name="content">
	<h:form>
	<h:commandButton value="Adicionar Pergunta" action="adicionarPergunta"/>
	<br></br>
	<br></br>
	<p:dataTable value="#{perguntasBEAN.perguntas}" var="item" paginator="true" rows="10">
		<f:facet name="header">
			<h:outputText value="Perguntas cadastradas no sistema"/>
		</f:facet>
		<p:column>
			<f:facet name="header">
				<h:outputText value="ID"/>
			</f:facet>
			<p:commandLink value="#{item.ID_PERGUNTA}"/>
		</p:column>
		
		<p:column>
			<f:facet name="header">
				<h:outputText value="PERGUNTA"/>
			</f:facet>
			<h:outputText value="#{item.PERGUNTA_TXT}" />
		</p:column>
		<p:column>
			<f:facet name="header">
				<h:outputText value="AÇÃO"/>
			</f:facet>
			<p:commandLink value="Editar Alternativas" action="#{perguntasBEAN.startEditarPergunta}">
				<f:setPropertyActionListener target="#{perguntasBEAN.perguntaSelecionada}" value="#{item}"/>
			</p:commandLink>
		</p:column>
	</p:dataTable>
	</h:form>
	</ui:define>
</ui:composition>
</h:body>
</html>